package com.cks.oss.controller;

import com.cks.commonutils.R;

import com.cks.oss.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/eduoss/fileoss")
@CrossOrigin
public class OssController {

    @Autowired
    private OssService ossService;

    //上传图像的方法
    @PostMapping
    public R uploadOssFile(MultipartFile file){
       String url= ossService.uploadavater(file);


        return R.ok().data("url", url);

    }
}
